import React from 'react';
import FlatButton from '../../../node_modules/material-ui/lib/flat-button';
import NewProjectDlg from "./projectManagement/newProjectDlg.jsx";
import dialogManager from './dialogManager.jsx';
import ProjectListNav from './projectManagement/projectListNav.jsx';
import HttpRequest from './HttpRequest.js';



let FunctionKeys = React.createClass({

    openNewProDlg: function(){
        dialogManager.getDialogRef("new_project_dlg").handleOpen();
        },
    openProjectList: function(){
        this.refs['project_list_nav'].handleToggle();
    },
    newProject:function(newProjectInfo){
        this,props.newProject(newProjectInfo);
    },
    render(){
        return(
            <div style = {{float:"right"}}>
                <FlatButton
                    label="新建"
                    secondary={true}
                    onTouchTap={this.openNewProDlg}
                />
                <FlatButton
                    label="列表"
                    secondary={true}
                    onTouchTap={this.openProjectList}
                />
                <ProjectListNav ref="project_list_nav" callbackParent={this.props.callbackParent}/>
                <NewProjectDlg newProjectComplete = {this.newProject}/>
            </div>
        );
    }

});
module.exports = FunctionKeys;